package com.twu.biblioteca;

import java.util.ArrayList;

public class list_book {
    ArrayList<book> book_list = new ArrayList<book>();
    public list_book(){
        for (int i = 0; i < 3; i++){
            book book= new book();
            book.setBookname("book"+i);
            book.setBookstatus(0);
            book.setBookholder(null);
            book_list.add(book);
        }
    }
    public void list_allbooks(){
        for (int i =0; i< book_list.size();i++){
            System.out.println(book_list.get(i).getBookname());
        }
    }
    public void list_avalliable_book(){
        for(int i =0; i< book_list.size();i++){
            if (book_list.get(i).getBookstatus()== 0)
            System.out.println(book_list.get(i).getBookname());
        }
    }
    public void list_book_with_holder(){
        for(int i =0; i< book_list.size();i++){
            System.out.println(book_list.get(i).getBookname()+" "+book_list.get(i).getBookholder());
        }
    }
    public ArrayList<book> get_book_list(){
        return book_list;
    }
}
